home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / os2 / zoc110.arj / ZOC / SCRIPT / SAMPLES / 2_META1 < prev    next >
Text File  |  1993-10-07  |  1KB  |  38 lines

  1. ////////////////////////////////////////////////////////
  2. // DEMONSTRATING METAS
  3. ////////////////////////////////////////////////////////
  4.  
  5. // A meta is a piece of program, that contains another
  6. // piece of program. 
  7. // you can think of it as a variable or macro.
  8.  
  9. // Every meta has a name and a value.
  10. // To access the value of a meta, write it's name
  11. // between two percent characters.
  12.  
  13. // Print the current date and time
  14. writeln "%date%"
  15. writeln "%time%"
  16.  
  17. // If you like (or need) you may change the value-expansion
  18. // character
  19. meta $
  20. writeln "$date$"
  21. writeln "$time$"
  22.  
  23. // But I like the % character best, so change it back.
  24. meta %
  25.  
  26. // A very important system meta is lastline.
  27. // It contains the value after waiting for something, contains
  28. // a parameter if called from dial oder script, or it contains the
  29. // result of some script commands.
  30. // So: Whenever you expect data from somewhere look for it in %lastline%
  31.  
  32. ask "Type something (or press ESC)"
  33. writeln "You typed '%lastline%'"
  34.  
  35. request "What do you want?" "Wine" "Women" "Song"
  36. notify "Sorry, I have no '%lastline%'"
  37.  
  38.